﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Sub_Full : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
            LinQ_RaoVatDataContext linQ = new LinQ_RaoVatDataContext();

        
            var TopLeft = 
                from vt in linQ.VI_TRI_QUANG_CAOs where vt.TenLoaiViTri == "TopLeft" && vt.Deleted == false select vt;

            if (TopLeft.Count() > 0)
            {
                Banner1.ViTriQuangCao = TopLeft.First();
            }

            var BottomLeft =
                    from vt in linQ.VI_TRI_QUANG_CAOs where vt.TenLoaiViTri == "BottomLeft" && vt.Deleted == false select vt;

            if (BottomLeft.Count() > 0)
            {
                Banner2.ViTriQuangCao = BottomLeft.First();
            }

            var BottomRight =
                       from vt in linQ.VI_TRI_QUANG_CAOs where vt.TenLoaiViTri == "BottomRight" && vt.Deleted == false select vt;

            if (BottomLeft.Count() > 0)
            {
                Banner4.ViTriQuangCao = BottomRight.First();
            }

            var TopRight =
                       from vt in linQ.VI_TRI_QUANG_CAOs where vt.TenLoaiViTri == "TopRight" && vt.Deleted == false select vt;

            if (BottomLeft.Count() > 0)
            {
                Banner3.ViTriQuangCao = TopRight.First();
            }
       
    }
}
